home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- #ifndef DEBUG
- #define DEBUG 0
- #endif
-
- #if DEBUG
- static char dbgMsg[256];
-
- #define assert(test) \
- if ( !(test) ) { \
- sprintf(dbgMsg,"<ASSERT FAILED> %s : line %d '%s'",__FILE__, __LINE__, #test ); \
- c2pstr(dbgMsg); \
- DebugStr((ConstStr255Param)dbgMsg); }
- #define check_noerr(err) \
- if ( err != 0 ) { \
- sprintf(dbgMsg,"<UNEXPECTED ERROR> %s : line %d - result = %d",__FILE__, __LINE__, err ); \
- c2pstr(dbgMsg); \
- DebugStr((ConstStr255Param)dbgMsg); }
- #else // !DEBUG
- #define assert(test) void(0)
- #define check_noerr(value) void(0)
- #endif // DEBUG